<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
	window.onload = function()
	{
		 var oForm = document.getElementById('form1');
		
			oForm.onsubmit = function()
			{
					alert(9);
			};
		
			oForm.onreset = function()
			{
					alert(999);
			};
	};
	</script>
</head>

<body>
<form id="form1" action="http://www.baidu.com">
	User: <input type="text" name="user">
	Password:	<input type="password" name="pass">
	<input type="submit" >
	<input type="reset">
</form>
</body>
</html>
